<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery.min.js"></script>
</head>
<body>
    <input id="autoCompt" type="text" onkeyup="getPrefixResult()"><button>搜索一下</button>
    <div id="callbackValue" style="width: 400px; background-color: antiquewhite;"></div>
</body>
<script>
    function getPrefixResult() {
        // console.log('================')
        var callbackValueBox = $('#callbackValue');
        callbackValueBox.html('');
        var value = $('#autoCompt').val();

        if(value && value.trim() && value.trim().length > 0) {
            $.get("/movie-suggest/findSuggestMovies", {text: value}, function(_data) {
                for(var i = 0; i < _data.length; i++) {
                    callbackValueBox.append('<p>' + _data[i] + "</p>");
                }
            }, "json");
        }
    }
</script>
</html>